// 打印
const num1 = 10;
let num2 = 20;

console.log("first js demo!" + "\t" + num1 + "\t" + num2);

// 方法2
const name = "season";
const age = 18;
console.log(`my nage is ${name} and my age is ${age}`);

// 方法1
const a = `my nage is ${name} and my age is ${age}`;
console.log(a);

const name1 = "sun wu kong, zhu ba jie, tang seng, sha seng";
// substring(0,5)选择打印     toUpperCase()变大写字母
console.log(name1.substring(0,5).toUpperCase());
// split("")分割函数
console.log(name1.split(""));
console.log(name1.split(", "));

//数组
// 两种定义数组方法：
const num3 = new Array(1,2,3,4,5,6,7,8);
console.log(num3);
const num4 = ["apple", "orange", "tiger", 1, 2, 3];
console.log(num4);
// 数组首加元素
num4.unshift("a");
// 数组尾加元素
num4.push("z");
// 数组尾 删除元素（括号里 不加参数）
num3.pop();
// 获取 元素坐标
num4.indexOf("orange");
// 判断 是否为数组
console.log(Array.isArray(num4));
